script_path=$(
  cd $(dirname $0)
  pwd
)
rm -f $script_path/../build/exercises-service
loginuser="root"
host="47.94.44.151"
echo "$script_path/build.sh"
bash $script_path/build.sh
scp -P 8765 $script_path/../build/exercises-service $loginuser@$host:/data/wwwroot/haibian/go/services/exercises/exercises-service-ready
ssh $loginuser@$host -p 8765 <<eoff
mv /data/wwwroot/haibian/go/services/exercises/exercises-service-ready /data/wwwroot/haibian/go/services/exercises/exercises-service

supervisorctl stop ExercisesService
sleep 2

supervisorctl start ExercisesService
exit
eoff
